﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;

using SMG.Application.DTO.Migration;

namespace SMG.ServiceContract.Migration
{
    /// <summary>
    /// 迁移task服务
    /// </summary>
    [ServiceContract]
    public interface IPlayMoveService
    {
        #region 一级任务

        /// <summary>
        /// 获取未处理的一级迁移任务
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        IEnumerable<PlayRecordDto> GetFirstMoveTask(Int32 count);

        /// <summary>
        /// 添加一级迁移任务
        /// </summary>
        /// <param name="taskDto"></param>
        /// <param name="taskDetailDtos"></param>
        /// <returns></returns>
        Boolean AddFirstMoveTask(FirstMoveTaskDto taskDto, IEnumerable<FirstMoveTaskDetailDto> taskDetailDtos);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="tasks"></param>
        /// <returns></returns>
        Boolean AddFirstMoveTask(IDictionary<FirstMoveTaskDto, IEnumerable<FirstMoveTaskDetailDto>> tasks);
        /// <summary>
        /// 根据节目图表id查询任务详细列表
        /// </summary>
        /// <param name="playId"></param>
        /// <returns></returns>
        IEnumerable<FirstMoveTaskDetailDto> QueryFirstTaskDetails(long playId);

        /// <summary>
        /// 获取主任务状态列表
        /// </summary>
        /// <param name="playId"></param>
        /// <returns></returns>
        IEnumerable<FirstMoveTaskStateDto> QueryFirstTaskState(long playId);

        /// <summary>
        /// 根据节目图表id查询任务详细状态列表
        /// </summary>
        /// <param name="playId"></param>
        /// <returns></returns>
        IEnumerable<FirstMoveTaskDetailStateDto> QueryFirstTaskDetailState(long playId);

        #endregion

        #region 二级任务

        /// <summary>
        /// 获取未处理的二级迁移任务
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        IEnumerable<PlayRecordDto> GetSecondMoveTask(Int32 count);
        /// <summary>
        /// 添加二级迁移任务
        /// </summary>
        /// <param name="taskDto"></param>
        /// <param name="taskDetailDtos"></param>
        /// <returns></returns>
        Boolean AddSecondMoveTask(SecondMoveTaskDto taskDto, IEnumerable<SecondMoveTaskDetailDto> taskDetailDtos);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="tasks"></param>
        /// <returns></returns>
        Boolean AddSecondMoveTask(IDictionary<SecondMoveTaskDto, IEnumerable<SecondMoveTaskDetailDto>> tasks);
        /// <summary>
        /// 设置节目单二级任务状态
        /// </summary>
        /// <param name="playRecords"></param>
        /// <returns></returns>
        Boolean SetPlaySecondMoveTask(PlayRecordDto playRecord);
        /// <summary>
        /// 设置节目单二级任务状态
        /// </summary>
        /// <param name="playRecords"></param>
        /// <returns></returns>
        Boolean SetPlaySecondMoveTask(IEnumerable<PlayRecordDto> playRecords);

        #endregion

        /// <summary>
        /// 解锁图文单记录
        /// </summary>
        /// <param name="playRecords"></param>
        /// <returns></returns>
        Boolean UnLockPlayRecord(PlayRecordDto playRecord);

        #region 上传xml

        /// <summary>
        /// 获取待上传的节目单列表
        /// </summary>
        /// <returns></returns>
        IEnumerable<PlayRecordDto> GetWaitUploadXmlPlay(Int32 count);

        /// <summary>
        /// 设置上传节目单xml状态
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Boolean SetWaitUploadXmlPlay(PlayRecordDto dto);

        #endregion

    }
}
